"""
@author: Sergiy Tsymbalyuk
"""

from pylons import request
from pylons.i18n import lazy_ugettext as _
from webhelpers.html.builder import HTML

from chowa.lib.site.layout import PanelComponent
from chowa.lib.helpers import url_outside

class SearchForm(object):
    __metaclass__ = PanelComponent
    
    def __init__(self, options={}):
        pass
    
    def render(self):
        text = HTML.tag('input', name='text', type='text', size=12)
        submit = HTML.tag('input', name='search', type='submit', class_='panel-button', value=_('Search'))
        action = url_outside('catalogue', controller='docs', action='search')
        html = HTML.tag('form', method='get', c=text+submit, action=action)
        return html
